package org.nox.helloseries.domain;

public enum Qualite
{

    SD( "" ), _720P( "720p" ), _1080P( "1080p" );

    private String value;

    Qualite( String value )
    {
        this.value = value;
    }

    public String getValue()
    {
        return value;
    }

    public static Qualite fromValue( String value ) throws IllegalArgumentException
    {
        for ( Qualite version : values() )
        {
            if ( version.getValue().toLowerCase().equals( value.toLowerCase().trim() ) )
            {
                return version;
            }
        }
        return null;
    }

    public boolean isHd()
    {
        return this == _720P || this == _1080P;
    }

    public static String stringValues()
    {
        return new String( _720P.getValue() + "|" + _1080P.getValue() );
    }
}
